package com.example.customapp.mycustomapp.base;

import android.app.Application;

import com.example.customapp.mycustomapp.utils.CustomCrashHandler;
import com.example.customapp.mycustomapp.utils.L;
import com.example.customapp.mycustomapp.utils.SpUtils;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
import com.zhy.autolayout.config.AutoLayoutConifg;

/**
 * 功能
 * Created by Administrator on 2015/11/18 0018.
 */
public class SystemApplication extends Application {
    private static SystemApplication instance;
    public SpUtils sharePreference = null;

    public static SystemApplication getInstance() {
        return instance;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        instance = this;
        sharePreference = new SpUtils();
        L.isDebug = true;
        ImageLoaderConfiguration configuration = ImageLoaderConfiguration.createDefault(this);
        ImageLoader.getInstance().init(configuration);
        //监听错误日志，保存到本地
        CustomCrashHandler mCustomCrashHandler = CustomCrashHandler.getInstance();
        mCustomCrashHandler.setCustomCrashHanler(getApplicationContext());
       /* 默认使用的高度是设备的可用高度，也就是不包括状态栏和底部的操作栏的，如果你希望拿设备的物理高度进行百分比化：
        可以在Application的onCreate方法中进行设置:
        AutoLayoutConifg.getInstance().useDeviceSize();*/

    }
}
